package guet.dream.servlet;

import guet.dream.category.Category;
import guet.dream.category.CategoryDao;
import guet.dream.category.CategoryDaoImpl;
import guet.dream.category.CategoryService;

import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;

/**
 * Servlet implementation class CategoryAjaxServlet
 * 
 */
public class CategoryAjaxServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    private CategoryDao categoryDao;


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        CategoryService categoryService = new CategoryService();
		
		String jsonData = categoryService.categoryMapToJson();
         Writer out = response.getWriter();
          out.write(jsonData);
          out.flush();
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String flag = (String) request.getAttribute("flag");
		int typeId = (Integer) request.getAttribute("id");
	}

}
